﻿@model IEnumerable<vngoodlife.Article>

@{
    Layout = null;
    }


@{ int i = 1;
   foreach (var item in Model)
   {
       if (i == 1)
       {
        @Html.Raw("<div class=\"blocks\">")
       }

        <div class="articlesnew">
            
            <a href="@Url.RouteUrl("ArticleDetailFrontend", new { articleSeoUrl = item.ArticleSeoUrl })">
                @if (item.ArtStatusID == 4)
                {
                   <img src="../../../Content/images/general/pin2.png" alt="" style="border: 0;position:absolute;margin: 5px 0 0 5px;"/>
                }
                
                <img src="../../../Content/images/article/thumbnail/@item.Photo" alt="@item.Photo" />
                <h2>@item.Title 
                @if (item.IsVideo)
                {
                   <img src="../../../Content/images/general/video-icon.gif" style="border: 0;"/>
                }
                @if (item.IsImage)
                {
                   <img src="../../../Content/images/general/icon-img-blue.gif" style="border: 0;"/>
                }
                </h2>
            </a><b>&ldquo;</b><span>@*bởi <a href="#">@item.Member.MemberName</a>*@ @vngoodlife.Util.GeneralClass.BuildDateTimeString(item.CreateDate)</span><b>&rdquo;</b>
            <content>@vngoodlife.Util.GeneralClass.CutStringByWords( item.Description, 30)</content>
        </div>

        if (i % 3 == 0)
        {
            @Html.Raw("</div>")
            @Html.Raw("<div class=\"blocks\">")
        }
        
        if (i == vngoodlife.Util.ConstantClass.ArticleHomePageStep) 
        { 
           @Html.Raw("</div>")
        }

        i++;
   }

   //Close div if not number of article does not divisible by 3
    if (i != (vngoodlife.Util.ConstantClass.ArticleHomePageStep + 1) && (i - 1) % 3 != 0)
   {
        @Html.Raw("</div>")
    }
}